package info.hexin.dubbo.test2.client.main;

import info.hexin.dubbo.test2.server.DemoServer;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import java.util.concurrent.TimeUnit;

public class DubboClient {

    public static void main(String[] args) {
        ClassPathXmlApplicationContext context =
                new ClassPathXmlApplicationContext(new String[]{"applicationConsumer.xml"});
        DemoServer demoServer = (DemoServer) context.getBean("demoService");
        try {
            for (int i = 0; i < 10000; i++) {
                System.out.println("clentSend:" + i);
                String servletResult = demoServer.sayHello("" + i);
                System.out.println("servletResult:" + servletResult);
                TimeUnit.SECONDS.sleep(1);
            }
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}
